﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestImplimentations
{
    public static class YammerMessageAPI
    {
        static public bool RunTest()
        {
                        var xml = @"<message><system-message>false</system-message><client-type>Twitter</client-type><web-url>https://www.yammer.com/messages/6244292</web-url><url>https://www.yammer.com/api/v1/messages/6244292</url><message-type>update</message-type><sender-type>user</sender-type><attachments /><thread-id>6244292</thread-id><id>6244292</id><replied-to-id nil=""true""></replied-to-id><body><parsed>[[tag:146561]] another week ends abruptly - 2 weeks left before a release-to-test</parsed><plain>#yam another week ends abruptly - 2 weeks left before a release-to-test</plain></body><sender-id>334309</sender-id><client-url>https://www.yammer.com/company/twitter_integration</client-url><created-at>2009-05-15T17:55:26Z</created-at></message>";

            var yammerMsg = (new YammerAPI.XMLParsers.MessageXMLParser()).Parse(xml);

            return string.Equals("Twitter", yammerMsg.ClientType) &&
                string.Equals("https://www.yammer.com/messages/6244292", yammerMsg.WebUrl) &&
                string.Equals("update", yammerMsg.MessageType) &&
                int.Equals(0, yammerMsg.Attachments.Count) &&
                string.Equals("334309", yammerMsg.SenderId) &&
                yammerMsg.References == null;
        }
    }
}
